﻿using System;

namespace Glue.Internals
{
    /// <summary>
    /// Types that can be mapped directly and do not need any submapping (nested mapping)
    /// </summary>
    internal class Primitives
    {
        public static object CreateInstance(Type type)
        {
            if (!type.IsPrimitive())
                throw new GlueException("'"+type.Name+"' is not a primitive type, and I only create instances of primitive types");
            if (type.Equals(typeof(String)))
                return "";
            return type.CreateInstance();
        }
    }
}
